Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thi.ng/diff

Package Overview
Dependencies
Maintainers
0
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/diff

Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs

  • 5.1.79
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
165
increased by43.48%
Maintainers
0
Weekly downloads
 
Created
Source

@thi.ng/diff

npm version npm downloads Mastodon Follow

[!NOTE] This is one of 199 standalone projects, maintained as part of the @thi.ng/umbrella monorepo and anti-framework.

🚀 Please help me to work full-time on these projects by sponsoring me on GitHub. Thank you! ❤️

About

Customizable diff implementations for arrays (sequential) & objects (associative), with or without linear edit logs.

Status

STABLE - used in production

Search or submit any issues for this package

Installation

yarn add @thi.ng/diff

ESM import:

import * as diff from "@thi.ng/diff";

Browser ESM import:

<script type="module" src="https://esm.run/@thi.ng/diff"></script>

JSDelivr documentation

For Node.js REPL:

const diff = await import("@thi.ng/diff");

Package sizes (brotli'd, pre-treeshake): ESM: 1.05 KB

Dependencies

Note: @thi.ng/api is in most cases a type-only import (not used at runtime)

API

Generated API docs

import { diffArray } from "@thi.ng/diff";

// diff w/ default diff mode
diffArray([1, 2, 3], [1, 2, 4], "full");
// {
//     distance: 2,
//     adds: { 2: 4 },
//     dels: { 2: 3 },
//     const: { 0: 1, 1: 2 },
//     linear: [0, 0, 1,  0, 1, 2,  -1, 2, 3,  1, 2, 4]
// }

Authors

If this project contributes to an academic publication, please cite it as:

@misc{thing-diff,
  title = "@thi.ng/diff",
  author = "Karsten Schmidt",
  note = "https://thi.ng/diff",
  year = 2016
}

License

© 2016 - 2024 Karsten Schmidt // Apache License 2.0

Keywords

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc